package com.fanxuankai.boot.canal.client.autoconfigure;

import com.fanxuankai.boot.canal.client.KafkaEntryConsumer;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.kafka.core.KafkaTemplate;

/**
 * @author fanxuankai
 */
@ConditionalOnClass({KafkaTemplate.class})
@ConditionalOnMissingClass({"com.fanxuankai.boot.mqbroker.producer.EventPublisher"})
@ConditionalOnProperty(name = CanalClientProperties.ENABLED, matchIfMissing = true)
public class CanalClientKafkaAutoConfiguration {
    @Bean
    public KafkaEntryConsumer kafkaEntryConsumer() {
        return new KafkaEntryConsumer();
    }
}
